<template>
  <div>
    <p>{{ count }}</p>
    <p>{{ name }}</p>

    <button @click="reset()">重置数据</button>
  </div>
</template>

<script setup>
  import { useCounterStore } from '@/store/counter'
  import { useAlertsStore } from '@/store/index'
  import { storeToRefs } from 'pinia';

  let store = useAlertsStore()

  const { count, name } = storeToRefs(store)
  count.value = 100
  const reset = () => {
    store.$reset()
  }
 
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
